Skip to content

feat: populate SymbolInformation.signature_documentation - #549

Merged
christoph-sg merged 1 commit into
mainfrom
signature-documentation
Nov 12, 2026
Merged

christoph-sg merged 1 commit into
mainfrom
signature-documentation

Conversation

@christoph-sg

Copy link
Copy Markdown
Contributor

scip-typescript has always rendered a symbol's signature as a ```ts code block at the start of SymbolInformation.documentation. scip.proto has a structured signature_documentation field for this and asks new indexers to keep only docstrings in documentation. This moves signatures (including the module "…" signature of file symbols) into signature_documentation with language typescript, which is TypeScript syntax even for JS and Svelte sources, so documentation now holds only JSDoc text.

Moving rather than duplicating is deliberate: Sourcegraph's hover (symbolHoverText) renders signature_documentation as a code block and then appends documentation, so emitting both would show the signature twice. Sourcegraph has read the field since at least 2024. Consumers that read only documentation will no longer see signatures. Signature occurrences (clickable types) are left for a follow-up.

Test plan

Snapshot outputs with showDocs now print signature_documentation lines instead of the code blocks. Also decoded indexes for the syntax and react fixtures: every symbol has a signature, and no documentation entry contains a code block.

Signatures used to be rendered as a ```ts code block at the start of
SymbolInformation.documentation. They now go in the structured
signature_documentation field (language "typescript"), and
documentation holds only docstrings, as scip.proto asks new indexers
to do.

Sourcegraph's hover renders signature_documentation as a code block
before documentation, so keeping both would show the signature twice.
Consumers that read only documentation will no longer see signatures.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1cefb-43ef-72b1-9eea-3323b0b1f550
Co-authored-by: Amp <amp@ampcode.com>
@christoph-sg
christoph-sg merged commit bc4f664 into main Nov 12, 2026
5 checks passed
@christoph-sg
christoph-sg deleted the signature-documentation branch November 12, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants